#include <iostream>
#include <vector>
#include <list>
using namespace std;
template<typename T>
void print(T a){
    for(auto& val:a){
        cout<<val<<" ";
    }
    cout<<endl;
}
int main()
{
    vector<int> a({1,2,3,4,1,2,3,4});
    list<int> b;
    print(a);
    b.insert(b.begin(),a.begin(),a.end());
    a.clear();
    b.sort();
    b.unique();
    a.insert(a.begin(),b.begin(),b.end());
    print(a);
    return 0;
}